class Node {
  data = null;
  next = null;
  constructor(value){
this.data = value;
this.next = null
  }
}


class NodeList {
  head = null;
  size = 0;
  constructor(){
this.head = null;
this.size = 0;
  }

  print(){
    let current = this.head;
    while(current){
      console.log(current.data);
      current = current.next;
    }
  }
}


let a = new Node(1);
let b = new Node(2);
a.next = b;
let c = new Node(3);
b.next = c;


let list = new NodeList();

list.head = a;

list.size = 3;
list.print();

